Skip to content

Fix isolation of login flows when Using Multiple AuthProvider Instances#327

Merged
DonOmalVindula merged 7 commits intoasgardeo:mainfrom
kavindadimuthu:fix/provider-login-race
Feb 16, 2026
Merged

Fix isolation of login flows when Using Multiple AuthProvider Instances#327
DonOmalVindula merged 7 commits intoasgardeo:mainfrom
kavindadimuthu:fix/provider-login-race

Conversation

@kavindadimuthu
Copy link
Contributor

@kavindadimuthu kavindadimuthu commented Jan 22, 2026

This pull request fix the isolation of login flows when Using Multiple AuthProvider Instances. The changes ensure that authentication flows and storage are correctly scoped to each instance, preventing conflicts when multiple auth clients are used in the same application. The update also adds utilities to detect if the current URL is intended for a specific instance.

Key changes include:

Multi-auth instance support in authClient:

  • Updated the legacy AsgardeoAuthClient to use an instance property for instanceID instead of a static class property, ensuring each client instance is independent. Storage keys and state parameters now include the correct instanceId. [1] [2] [3] [4]

URL utilities and authentication flow:

  • Added the hasCalledForThisInstanceInUrl utility to check if the current URL's state parameter matches the expected instance, and exported it from the browser SDK. [1] [2]
  • Updated the useBrowserUrl React hook and AsgardeoProvider to use the new utility, ensuring authentication callbacks are processed only by the correct client instance. [1] [2] [3] [4] [5]

Related Issues

Related PRs

Checklist

  • Followed the CONTRIBUTING guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)

Security checks

brionmario
brionmario previously approved these changes Feb 3, 2026
@kavindadimuthu kavindadimuthu force-pushed the fix/provider-login-race branch from e1ce65f to 702906a Compare February 13, 2026 12:22
@DonOmalVindula
Copy link
Contributor

Let's add a changeset here by running pnpm changeset at the project root and selecting the changed packages. If there are no breaking changes, we can do a patch release.

@kavindadimuthu kavindadimuthu force-pushed the fix/provider-login-race branch from 702906a to 10ca5ed Compare February 16, 2026 06:33
@asgardeo-github-bot
Copy link

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

@DonOmalVindula DonOmalVindula merged commit fbc95de into asgardeo:main Feb 16, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Fail to isolate login flows when Using Multiple Nested AuthProvider Instances with unique instanceID

4 participants